import request from '@/utils/request'

export function login(data) {
  return request({
    url: '/index/login',
    method: 'post',
    data
  })
}

export function getInfo(data) {
  return request({
    url: '/index/userinfo',
    method: 'post',
    data
  })
}

export function getInfolist() {
  return request({
    url: '/permission/menu',
    method: 'get'
  })
}

export function yonghuqxlist(params) {
  return request({
    url: '/permission/role',
    method: 'get',
    params
  })
}

export function deletejs(id) {
  return request({
    url: `/permission/role/${id}`,
    method: 'delete'
  })
}

// 获取用户信息
export function yonghujsxq(id) {
  return request({
    url: `/permission/role/${id}`,
    method: 'get'
  })
}

// 添加新用户
export function addyhlist(data) {
  return request({
    url: '/permission/role',
    method: 'post',
    data
  })
}

// 修改用户信息
export function xgyhlist(id, data) {
  return request({
    url: `/permission/role/${id}`,
    method: 'put',
    data
  })
}
